<?php
/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2017/7/5
 * Time: 16:38
 */
namespace app\admin\validate;
use think\Validate;

class Goods extends Validate
{
    protected $rule =   [
        'type_id'  => 'require|number',
        'goods_name'=>'require|max:25',
        'assessment_name'=>'require|max:25',
        'goods_life'=>'require|number',
        'cycle_id'=>'require|number',
        'window_period'=>'require',
        'status'=>'require|number|between:0,2',
        'price'=>'require|number',
        'goods_img'=>'file|fileExt:jpg,png,gif|fileSize:3145728',
    ];

    protected $message  =   [
        'type_id.require' => '产品类型不能为空',
        'type_id.number'  => '请选择正确的产品类型',
        'goods_name.require'   => '产品名称不能为空',
        'goods_name.max' =>'产品名称长度不能超过25位',
        'goods_life.require'=>'产品服务年限不能为空',
        'goods_life.number'=>'请选择合适的产品服务年限',
        'cycle_id.require'=>'评估周期不能为空',
        'cycle_id.number'=>'请选择合适的评估周期',
        'window_period'=>'窗口期不能为空',
        'status.require'=>'状态不能为空',
        'status.number'=>'请选择合适的状态',
        'status.between'=>'状态格式错误',
        'price.require'=>'价格不能为空',
        'price.number'=>'价格只能是数字',
        'goods_img.file'=>'文件类型错误',
        'goods_img.fileExt'=>'文件格式错误',
        'goods_img.fileSize'=>'上传文件大小超过上限',

    ];


}